package ngat.oss;

import ngat.message.OSS.*;

import java.io.*;
import java.util.*;

/** 
 * Client: USR.
 * Action: Retrives the current system news message.
 * $Id: GET_NEWSImpl.java,v 1.1 2006/11/27 08:45:00 snf Exp $
 */
public class GET_NEWSImpl extends TransactionImpl {

    protected int fromIndex;

    /** Create a GET_NEWSImpl for the supplied request.*/
    public GET_NEWSImpl(GET_NEWS request) {
	super(request);
	fromIndex = request.getFromIndex();
    }

    /**
     * Get the news.
     * @return news + time.
     */
    public TRANSACTION_DONE exec() {
	Vector news = ServerContext.getNewsSince(fromIndex);
	
	GET_NEWS_DONE done  = new GET_NEWS_DONE(id);
	done.setSuccessful(true);
	done.setNews(news);
	return done;
    }

}

/** $Log: GET_NEWSImpl.java,v $
/** Revision 1.1  2006/11/27 08:45:00  snf
/** Initial revision
/**
/** Revision 1.1  2001/02/23 18:51:14  snf
/** Initial revision
/** */
